home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / bsd / rpcsvc / spray.x < prev    next >
Text File  |  1990-01-29  |  997b  |  60 lines

  1. /*    @(#)spray.x    1.2 88/05/08 4.0NFSSRC SMI    */
  2.  
  3. /* 
  4.  * Copyright (c) 1988 by Sun Microsystems, Inc.
  5.  * @(#) from SUN 1.3
  6.  */
  7.  
  8. /*
  9.  * Spray a server with packets
  10.  * Useful for testing flakiness of network interfaces
  11.  */
  12.  
  13. const SPRAYMAX = 8845;    /* max amount can spray */
  14.  
  15. /*
  16.  * GMT since 0:00, 1 January 1970
  17.  */
  18. struct spraytimeval {
  19.     unsigned int sec;
  20.     unsigned int usec;
  21. };
  22.  
  23. /*
  24.  * spray statistics
  25.  */
  26. struct spraycumul {
  27.     unsigned int counter;
  28.     spraytimeval clock;
  29. };
  30.  
  31. /*
  32.  * spray data
  33.  */
  34. typedef opaque sprayarr<SPRAYMAX>;
  35.  
  36. program SPRAYPROG {
  37.     version SPRAYVERS {
  38.         /*
  39.          * Just throw away the data and increment the counter
  40.          * This call never returns, so the client should always 
  41.          * time it out.
  42.          */
  43.         void
  44.         SPRAYPROC_SPRAY(sprayarr) = 1;
  45.  
  46.         /*
  47.          * Get the value of the counter and elapsed time  since
  48.          * last CLEAR.
  49.          */
  50.         spraycumul    
  51.         SPRAYPROC_GET(void) = 2;
  52.  
  53.         /*
  54.          * Clear the counter and reset the elapsed time
  55.          */
  56.         void
  57.         SPRAYPROC_CLEAR(void) = 3;
  58.     } = 1;
  59. } = 100012;
  60.